<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE HTML>
<html>
<head>
<title>My JSP 'login.jsp' starting page</title>
<link href="img/ico.ico" rel="shortcut icon">

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-min.js"></script>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">


<style type="text/css">
body {
	background-image: url("img/login-bg.png");
}

.content {
	width: 444px;
	margin: 0 auto 0 auto;
	padding: 15px 0 0px 40px;
	border: 1px solid #999;
	border-radius: 6px 6px 6px 6px;
	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);
	opacity: 0.8;
	background-color:#F9F9F9;
}

.header {
	width: 470px;
	margin: 50px auto 35px auto;
}

a:hover {
	text-decoration: none;
}

label {
	font-size: 20px;
}
</style>
</head>

<body>
<br/>
	<h2 style="font-family: 方正静蕾简体;margin-left: 40%">用户登录</h2>
	<div class="container">

		<div class="header">
			<h1>
				<a href="index.jsp">(销售-临床)管理系统</a>
			</h1>
		</div>


		<div class="content">
			<form name="formOfUser" action="verifyLogin.action">
				<label><i style="margin-top: 8px;" class="icon-user"></i> 用户名 </label><input name="user.username" type="text" /><br />
				<span class="usernameTishi"></span><label> 密码</label><input
					name="user.password" type="password" /><br /> <span
					class="passwordTishi"></span> <input type="hidden" name="task"
					value="${task}" />
			</form>
			<input id="loginBtn"
				style="margin-bottom: 12px;margin-left: 60px;width: 80px;height: 35px;font-size: 20px;"
				class="btn btn-success" type="button" value="登陆" />
		</div>
	</div>
</body>
<script type="text/javascript">
	$(function() {
		$("#loginBtn").click(function() {
			alert("弹框");
			var username = $("input[name='user.username']").val();
			var password = $("input[name='user.password']").val();
			//alert(username);
			//alert(password);
			$("input[name='user.username']").focus(function() {
				$("usernameTishi").text("");
			});
			$("input[name='user.password']").focus(function() {
				$("passwordTishi").text("");
			});
			if (username.trim() == "") {
				$("usernameTishi").text("请输入用户名");
				$("usernameTishi").css("color", "red");
				return false;
			}
			if (password.trim() == "") {
				$("passwordTishi").text("请输入密码");
				$("passwordTishi").css("color", "red");
				return false;
			}
			//alert($("input[name='user.username']").val());
			//alert($("input[name='user.password']").val());
			/*$.post("verifyLogin.action", {
				"user.username" : $("input[name='user.username']").val(),
				"user.password" : $("input[name='user.password']").val(),
				"task" : $("input[name='task']").val()
			}, function(data) {
				if (data == "true") {
					alert("用户名或密码错误!");
					return false;
				}else{
					
				}
			});*/

			$("form[name='formOfUser']").submit();//submit();
		});
	});
</script>
</html>
